package io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

/**
 * 简单记事本工具
 */
public class TestNote {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos=new FileOutputStream("note.txt");
        Scanner scan=new Scanner(System.in);
        while (true){
            System.out.println("请输入内容");
            String line=scan.nextLine();
            byte[] data=line.getBytes(StandardCharsets.UTF_8);
            if(line.equals("exit")){
                System.out.println("正在退出");
                break;
            }
            fos.write(data);
        }
        System.out.println("成功");
        fos.close();
    }
}
